home *** CD-ROM | disk | FTP | other *** search
/ Chip: 2005 Utilities / CHIP Utilities 2005.7z / CHIP Utilities 2005.iso / CHIP Utilities / Zarzadzanie i bezpieczenstwo systemu / MBSA / MBSASetup-EN.msi / Data.Cab / copyreporttxt.xsl < prev    next >
Extensible Markup Language  |  2004-08-13  |  13KB  |  176 lines

  1. <?xml version="1.0"?> 
  2. <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3.     
  4. <xsl:variable name="ScoreLookup">
  5.   <c score="0" url="Graphics/dash.gif" alttext="Check Not Performed"/>
  6.   <c score="1" url="Graphics/excl_red.gif" alttext="Unable to scan"/>
  7.   <c score="2" url="Graphics/x_red.gif" alttext="Check failed (critical)"/>
  8.   <c score="3" url="Graphics/x_gold.gif" alttext="Check failed (non-critical)"/>
  9.   <c score="4" url="Graphics/astrx.gif" alttext="Best practice"/>
  10.   <c score="5" url="Graphics/chek_grn.gif" alttext="Check passed"/>
  11.   <c score="6" url="Graphics/dash.gif" alttext="Check not performed"/>
  12.   <c score="7" url="Graphics/info.gif" alttext="Additional information"/>
  13.  
  14. </xsl:variable>
  15.     
  16. <xsl:variable name="Assessment">
  17.   <c score="1" text="Incomplete Scan" longtext="Could not complete one or more requested checks."/>
  18.   <c score="2" text="Severe Risk" longtext="One or more critical checks failed."/>
  19.   <c score="3" text="Potential Risk" longtext="One or more non-critical checks failed."/>
  20.   <c score="4" text="Security FYIs" longtext=""/>
  21.   <c score="5" text="Strong Security" longtext="All checks were passed."/>
  22. </xsl:variable>
  23.     
  24. <xsl:variable name="FileName">FileNameHere</xsl:variable>
  25.         
  26. <xsl:template match="SecScan">
  27. <xsl:choose>
  28. <xsl:when test="Check[@Type='5'][@Cat='1']">
  29. <xsl:for-each select="Check[@Type='5'][@Cat='1']">
  30. <xsl:sort order="sortorder" select="sortfield"/>
  31. <xsl:variable name="score" select="@Grade"/>
  32. Security Updates<xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  33. </xsl:when>
  34. </xsl:choose>
  35. <xsl:choose>
  36. <xsl:when test="Check[@Type='1'][@Cat='1']">
  37. <xsl:for-each select="Check[@Type='1'][@Cat='1']">
  38. <xsl:sort order="sortorder" select="sortfield"/>
  39. <xsl:variable name="score" select="@Grade"/>
  40. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  41. </xsl:when>
  42. </xsl:choose>
  43. <xsl:choose>
  44. <xsl:when test="Check[@Type='1'][@Cat='2']">
  45. <xsl:for-each select="Check[@Type='1'][@Cat='2']">
  46. <xsl:sort order="sortorder" select="sortfield"/>
  47. <xsl:variable name="score" select="@Grade"/>
  48. <xsl:choose>
  49. <xsl:when test="@ID='121'">
  50. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/>
  51. </xsl:when>
  52. <xsl:when test="@ID='10121'">
  53. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/>
  54. </xsl:when>
  55. <xsl:when test="@ID='101'">
  56. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/>
  57. </xsl:when>
  58. <xsl:when test="@ID='10101'">
  59. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=7]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/>
  60. </xsl:when>
  61. <xsl:otherwise>
  62. Windows Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/>
  63. </xsl:otherwise>
  64. </xsl:choose>
  65. </xsl:for-each>
  66. </xsl:when>
  67. </xsl:choose>
  68. <xsl:choose>
  69. <xsl:when test="Check[@Type='3'][@Cat='1']">
  70. <xsl:for-each select="Check[@Type='3'][@Cat='1']">
  71. <xsl:sort order="sortorder" select="sortfield"/>
  72. <xsl:variable name="score" select="@Grade"/>
  73. Internet Information Services (IIS) Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  74. </xsl:when>
  75. </xsl:choose>
  76. <xsl:choose>
  77. <xsl:when test="Check[@Type='3'][@Cat='2']">        
  78. <xsl:for-each select="Check[@Type='3'][@Cat='2']">
  79. <xsl:sort order="sortorder" select="sortfield"/>
  80. <xsl:variable name="score" select="@Grade"/>
  81. Internet Information Services (IIS) Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  82. </xsl:when>
  83. </xsl:choose>
  84. <xsl:choose>
  85. <xsl:when test="Check[@Type='3'][@Cat='4']">
  86. <xsl:for-each select="Check[@Type='3'][@Cat='4']">
  87. <xsl:sort order="sortorder" select="sortfield"/>
  88. <xsl:variable name="score" select="@Grade"/>
  89. Internet Information Services (IIS) Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  90. </xsl:when>
  91. </xsl:choose>
  92.  
  93. <!-- One tag per SQL Instance, MBSA V1.1 and later -->
  94. <xsl:choose>
  95.     <xsl:when test="SQLInstance">
  96.         <xsl:for-each select=".">
  97.             <xsl:apply-templates select="SQLInstance"/>
  98.         </xsl:for-each>
  99.     </xsl:when>
  100. </xsl:choose>
  101.  
  102. <xsl:choose>
  103. <xsl:when test="Check[@Type='2'][@Cat='1']">
  104. <xsl:for-each select="Check[@Type='2'][@Cat='1']">
  105. <xsl:sort order="sortorder" select="sortfield"/>
  106. <xsl:variable name="score" select="@Grade"/>
  107. SQL Server Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  108. </xsl:when>
  109. </xsl:choose>
  110. <xsl:choose>
  111. <xsl:when test="Check[@Type='2'][@Cat='2']">
  112. <xsl:for-each select="Check[@Type='2'][@Cat='2']">
  113. <xsl:sort order="sortorder" select="sortfield"/>
  114. <xsl:variable name="score" select="@Grade"/>
  115. SQL Server Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  116. </xsl:when>
  117. </xsl:choose>
  118. <xsl:choose>
  119. <xsl:when test="Check[@Type='2'][@Cat='4']">
  120. <xsl:for-each select="Check[@Type='2'][@Cat='4']">
  121. <xsl:sort order="sortorder" select="sortfield"/>
  122. <xsl:variable name="score" select="@Grade"/>
  123. SQL Server Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Product Status<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  124. </xsl:when>
  125. </xsl:choose>
  126.             
  127. <xsl:choose>
  128. <xsl:when test="Check[@Type='4'][@Cat='1']">
  129. <xsl:for-each select="Check[@Type='4'][@Cat='1']">
  130. <xsl:sort order="sortorder" select="sortfield"/>
  131. <xsl:variable name="score" select="@Grade"/>
  132. Desktop Application Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  133. </xsl:when>
  134. </xsl:choose>
  135. <xsl:choose>
  136. <xsl:when test="Check[@Type='4'][@Cat='2']">
  137. <xsl:for-each select="Check[@Type='4'][@Cat='2']">
  138. <xsl:sort order="sortorder" select="sortfield"/>
  139. <xsl:variable name="score" select="@Grade"/>
  140. Desktop Application Scan Results<xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  141. </xsl:when>
  142. </xsl:choose>
  143.             
  144. </xsl:template>
  145.  
  146. <!-- SQL Instance section -->
  147. <xsl:template match="SQLInstance">
  148. <xsl:variable name="instance" select="@Name"/>
  149. <xsl:choose>
  150. <xsl:when test="Check[@Type='2'][@Cat='1']">
  151. <xsl:for-each select="Check[@Type='2'][@Cat='1']">
  152. <xsl:sort order="sortorder" select="sortfield"/>
  153. <xsl:variable name="score" select="@Grade"/>
  154. SQL Server Instance: <xsl:value-of select="$instance"/><xsl:text disable-output-escaping="yes"> </xsl:text>Vulnerabilities<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=$score]/@alttext"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  155. </xsl:when>
  156. </xsl:choose>
  157. <xsl:choose>
  158. <xsl:when test="Check[@Type='2'][@Cat='2']">
  159. <xsl:for-each select="Check[@Type='2'][@Cat='2']">
  160. <xsl:sort order="sortorder" select="sortfield"/>
  161. <xsl:variable name="score" select="@Grade"/>
  162. SQL Server Instance: <xsl:value-of select="$instance"/><xsl:text disable-output-escaping="yes"> </xsl:text>Additional System Information<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  163. </xsl:when>
  164. </xsl:choose>
  165. <xsl:choose>
  166. <xsl:when test="Check[@Type='2'][@Cat='4']">
  167. <xsl:for-each select="Check[@Type='2'][@Cat='4']">
  168. <xsl:sort order="sortorder" select="sortfield"/>
  169. <xsl:variable name="score" select="@Grade"/>
  170. SQL Server Instance: <xsl:value-of select="$instance"/><xsl:text disable-output-escaping="yes"> </xsl:text>Product Status<xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="document('')/*/xsl:variable[@name='ScoreLookup']/c[@score=4]/@alttext" /><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="@Name"/><xsl:text disable-output-escaping="yes"> </xsl:text><xsl:value-of select="Advice"/></xsl:for-each>
  171. </xsl:when>
  172. </xsl:choose>
  173. </xsl:template>
  174.  
  175. </xsl:stylesheet>
  176.